Cocos2d-x Cookbook by unknow
Author:unknow
Language: eng
Format: epub
Publisher: Packt Publishing
Let's run this code. You will see the huge HelloWorld.png image. Further, you will see that you can scroll it by swiping.
How it works...
You create an instance of the ScrollView class by using the create method without arguments.
You set the direction of the scroll view by using the setDirection method. In this case, we want to scroll up and down, and left and right, so you should set ui::ScrollView::Direction::BOTH. This implies that we can scroll in both the vertical and the horizontal directions. If you want to scroll just up and down, you set ui::ScrollView::Direction::VERTICAL. If you want to scroll just left and right, you set ui::ScrollView::Direction::HORIZONTAL.
If you want to bounce when it is scrolled at the edge of the area, you should set true by using the setBounceEnabled method.
You will provide the content to be displayed in the scroll view. Here, we have used HelloWorld.png that has been scaled twice.
You have to specify the size of the content in the scroll view by using the setInnerContainerSize method. In this case, we specify double the size of HelloWorld.png in the setInnerContainerSize method
You have to specify the size of the scroll view by using the setContentSize method. In this case, we specify the original size of HelloWorld.png by using the setContentSize method.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Personalized inhaled bacteriophage therapy for treatment of multidrug-resistant Pseudomonas aeruginosa in cystic fibrosis by unknow(177752)
CONSORT 2025 statement: updated guideline for reporting randomized trials by unknow(86242)
Critical evaluation of the ProfiLER-02 study design and outcomes by Vivek Subbiah & Razelle Kurzrock(85794)
Cardiac gene therapy makes a comeback by Oliver J. Müller & Susanne Hille & Anca Kliesow Remes(85587)
Whisky: Malt Whiskies of Scotland (Collins Little Books) by dominic roskrow(74442)
Unveiling the design rules for tunable emission in graphene quantum dots: A high-throughput TDDFT and machine learning perspective by Şener Özönder & Mustafa Coşkun Özdemir & Caner Ünlü(50894)
A yeast-based oral therapeutic delivers immune checkpoint inhibitors to reduce intestinal tumor burden by unknow(40265)
Covalent hitchhikers guide proteins to the nucleus by Alexander F. Russell & Madeline F. Currie & Champak Chatterjee(40217)
Meet the Authors: Christopher R. Mansfield and Emily R. Derbyshire by Christopher R. Mansfield & Emily R. Derbyshire(40098)
Alkaline-earth metals promote propane dehydrogenation with carbon dioxide through geometric effects: Altering the reaction pathway by unknow(32736)
Induced iron vacancies boosting FeOOH loaded on sustainable Fenton-like collagen fiber membrane for efficient removal of emerging contaminants by unknow(32509)
Efficient electric-field-assisted photochemical conversion of methane to n-propanol exclusively over penetrated TiO2Ti hollow fibers by Guanghui Feng(32454)
Bi2SiO5 nanosheets as piezo-photocatalyst for efficient degradation of 2,4-Dichlorophenol by Hangyu Shi & Yifu Li & Lishan Zhang & Guoguan Liu & Qian Zhang & Xuan Ru & Shan Zhong(32391)
A novel NDIPTA organic heterojunction photocatalyst with built-in electric field for efficient hydrogen production by Jiahui Yang & Baojun Ma & Yongfa Zhu(32364)
Enhanced conversion of methane to liquid-phase oxygenates via hollow ferrite nanotube@horseradish peroxidase based photoenzymatic catalysis by Jun Duan & Shiying Fan & Xinyong Li & Shaomin Liu(32333)
Ordered macroporous superstructure of defective carbon adorned with tiny cobalt sulfide for selective electrocatalytic hydrogenation of cinnamaldehyde by Xiao-Shi Yuan & Sheng-Hua Zhou & San-Mei Wang & Wenbo Wei & Xiaofang Li & Xin-Tao Wu & Qi-Long Zhu(32260)
What's Done in Darkness by Kayla Perrin(27152)
Topological analysis of non-conjugated ethylene oxide cored dendrimers decorated with tetraphenylethylene: Insights from degree-based descriptors using the polynomial approach by A Theertha Nair & D Antony Xavier & Annmaria Baby & S Akhila(26532)
Investigation of mechanical and self-healing properties of hydroxyl-terminated polybutadiene functionalized with 2-ureido-4-pyrimidinone by Mohsen Kazazi & Mehran Hayaty & Ali Mousaviazar(26460)